﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

using CanDoo.Core.Data;
using Microsoft.AspNet.Identity;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;
using System.Security.Claims;
using System.Threading.Tasks;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——系统管理员
    /// </summary>
    public class Administrator : EntityBase, ICreatedTime, IAudited
    {
        /// <summary>
        /// 老系统主键
        /// </summary>
        public Guid? oId { get; set; }

        /// <summary>
        ///姓名
        /// </summary>
        [Display(Name = "姓名")]
        public override string Name { get; set; }

        /// <summary>
        ///性别
        /// </summary>
        [Required]
        [Display(Name = "性别")]
        public int Sex { get; set; }

        /// <summary>
        ///邮箱
        /// </summary>
        [StringLength(100)]
        [Display(Name = "邮箱")]
        public string Email { get; set; }

        /// <summary>
        ///地址
        /// </summary>
        [StringLength(120)]
        [Display(Name = "地址")]
        public string Address { get; set; }

        /// <summary>
        ///手机
        /// </summary>
        [StringLength(50)]
        [Display(Name = "手机")]
        public string Mobile { get; set; }

        /// <summary>
        ///电话
        /// </summary>
        [StringLength(50)]
        [Display(Name = "电话")]
        public string Phone { get; set; }

        /// <summary>
        ///QQ号
        /// </summary>
        [StringLength(50)]
        [Display(Name = "QQ号")]
        public string QQ { get; set; }

        /// <summary>
        ///生日
        /// </summary>
        [Display(Name = "生日")]
        public DateTime? Birthday { get; set; }

        /// <summary>
        ///证件号码
        /// </summary>
        [StringLength(50)]
        [Display(Name = "证件号码")]
        public string IDCard { get; set; }

        /// <summary>
        ///每页显示数
        /// </summary>
        [Required]
        [Display(Name = "每页显示数")]
        public int PageSize { get; set; }


        /// <summary>
        ///部门
        /// </summary>
        [Display(Name = "部门")]
        public virtual Department Department { get; set; }
        /// <summary>
        ///部门外键
        /// </summary>
        [Display(Name = "部门外键")]
        public long? DepartmentId { get; set; }

        /// <summary>
        ///上级用户
        /// </summary>
        [Display(Name = "上级用户")]
        public virtual User User { get; set; }
        /// <summary>
        ///上级用户外键
        /// </summary>
        [Display(Name = "上级用户外键")]
        public long UserId { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [StringLength(500)]
        [Display(Name = "备注")]
        public string Remark { get; set; }

        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
